<?php
namespace app\common;

class Result
{
    public static function success($data = null, $msg = '操作成功')
    {
        return json(['code' => 200, 'msg' => $msg, 'data' => $data]);
    }

    public static function error($msg = 'error', $code = 400)
    {
        return json(['code' => $code, 'msg' => $msg]);
    }
}
